﻿Imports xPackage3.STFS.Package
Imports X360.STFS
Imports PackageIO
Public Class Form9
    Dim open As New OpenFileDialog
    Private Sub Form9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      
    End Sub

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Try
            open.Title = "Open a Con File"
            open.ShowDialog()

            Dim STFS As New xPackage3.STFS.Package(open.FileName)

            TextBox1.Text = STFS.ProfileID
            TextBox2.Text = STFS.ConsoleID
            TextBox3.Text = STFS.DeviceID
            PictureBox1.Image = STFS.PackageImage


        Catch ex As Exception

        End Try
        Dim STFS2 As New STFSPackage(open.FileName, Nothing)
        For Each Entry In STFS2.FileDirectory
            Dim list As New ListViewItem
            list.SubItems.Add(Entry.BlockCount)


        Next
    End Sub

    Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
        Try
            Dim STFS1 As New STFSPackage(open.FileName, Nothing)
            STFS1.FlushPackage(New RSAParams(Application.StartupPath + "C:\Users\Tim\Desktop\Upper Playground 2011\Upper Playground 2011\KV.bin"))
            MessageBox.Show("Rehashed And Resigned!")
        Catch ex As Exception
            MessageBox.Show(ex.Message)

        End Try
    End Sub
End Class